<script setup>
  // 1. 先导入仓库 useStockStore是一个函数
  import { useStockStore } from '@/store/stock'
  // 先使用
  const stockStore = useStockStore()
</script>

<template>
  <div>
    <h3>Add组件</h3>
    <p>已知库存数: {{ stockStore.stock }}</p>
    <button @click="stockStore.addStock()">库存+1</button>
  </div>
</template>


<style scoped></style>